import Vue from 'vue'
import Router from 'vue-router'
import axios from 'axios'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import vuescroll from 'vuescroll/dist/vuescroll-native'
import md5 from 'js-md5'
import App from './App.vue'
import router from './router'
import FormRule from './FormRule'
import store from './store'
import api from './api'

Vue.use(ElementUI);
Vue.use(vuescroll);

Vue.prototype.$md5 = md5;
Vue.prototype.FormRule = FormRule;
Vue.prototype.$store = store;
Vue.prototype.$api = api;

Vue.config.errorHandler = function(err, vm, info) {
	console.log(`${err.toString()}\nInfo: ${info}`);
}
Vue.config.productionTip = false;

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

new Vue({
	router,
	render: h => h(App)
}).$mount('#app')
